package com.mql.ganio.ui.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.mql.ganio.R;
import com.mql.ganio.ui.LoginActivity;
import com.mql.ganio.widget.parallaxpager.ParallaxContainer;

import butterknife.Bind;
import butterknife.ButterKnife;

public class WelcomeActivity extends Activity {

    @Bind(R.id.parallax_container)
    ParallaxContainer parallaxContainer;
    @Bind(R.id.iv_man)
    ImageView ivMan;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        ButterKnife.bind(this);
        if (android.os.Build.VERSION.SDK_INT > 10) {

            if (parallaxContainer != null) {
                parallaxContainer.setImage(ivMan);
                parallaxContainer.setLooping(false);

                ivMan.setVisibility(View.VISIBLE);
                parallaxContainer.setupChildren(getLayoutInflater(),
                        R.layout.view_intro_1, R.layout.view_intro_2,
                        R.layout.view_intro_3, R.layout.view_intro_4,
                        R.layout.view_intro_5);
            }
        } else {

        }
        TextView txtJump = (TextView) findViewById(R.id.txt_jump);
        txtJump.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(WelcomeActivity.this, LoginActivity.class);
                startActivity(intent);
            }
        });
    }
}
